package ch04_prototype.baseclone;

/**
 *
 *
 * @author guodd
 * @version 1.0 use jdk 1.8
 */
public class MainTest {
    public static void main(String[] args) throws Exception {
        Mail mail = new Mail();
        mail.setContent("初始化..");
        for (int i = 0; i < 10; i++) {
            Mail mailTemp = (Mail) mail.clone();
            mailTemp.setName("姓名" + i);
            mailTemp.setEmailAdd("地址" + i);
            mailTemp.setContent("内容" + i);
            MailUtils.sendMail(mailTemp);
        }
        MailUtils.saveMail(mail);
    }
}
